import java.io.IOException;
import java.net.URI;

import cn.seaboot.commons.http.call.TextHandler;
import cn.seaboot.commons.lang.P;
import org.apache.hc.core5.http.ParseException;

import cn.seaboot.commons.http.HttpClient;
import cn.seaboot.commons.http.HttpRequest;

/**
 * @author Mr.css
 * @version 2022-11-14 10:23
 */
public class HttpClientExample {

    public static void main(String[] args) throws IOException, ParseException {
        HttpClient httpClient = new HttpClient();
        httpClient.withDefaultSetting();

        HttpRequest request = httpClient.get(URI.create("https://www.baidu.com/"));
        String text = request.execute(new TextHandler(P.UTF_8));

        System.out.println(text);
        httpClient.close();
    }
}
